package com.share.openfeign;

import com.share.domain.RuleVo;
import com.share.result.JSONResult;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class RuleOpenfeignFallbackFactory implements FallbackFactory<RuleOpenfeign> {
    @Override
    public RuleOpenfeign create(Throwable cause) {
        return new RuleOpenfeign() {
            @Override
            public JSONResult pricing(RuleVo ruleVo) {
                return JSONResult.error("计价失败");
            }

            @Override
            public JSONResult baseFee() {
                return JSONResult.error("获取数据失败");
            }
        };
    }
}
